package web.dmt.db;

import java.sql.*;
import javax.sql.*;
import javax.naming.*;

public class Conn {



private static final String DBDRIVER = "org.gjt.mm.mysql.Driver";
private static final String DBURL = "jdbc:mysql://localhost:3306/tx";
private static final String DBUSER = "root";
private static final String DBPASSWORD = "dmtds";
private Connection conn = null;

public Conn() throws Exception {
	try {
		Class.forName(DBDRIVER);
		this.conn = DriverManager.getConnection(DBURL, DBUSER, DBPASSWORD);
	} catch (Exception e) {
		throw e;
	}
}

public Connection getConnection() {
	return this.conn;
}

public void close() throws Exception {
	if (this.conn != null) {
		try {
			this.conn.close();
		} catch (Exception e) {
			throw e;
		}
	}
}
}
